<template>
	<view style="display: flex; flex-direction: column; align-items: center; padding-top:20vh ;">
		<z-paging :show-refresher-when-reload="false"  show-refresher-update-time  ref="paging" v-model="dataList" @query="queryList">
			<!-- z-paging默认铺满全屏，此时页面所有view都应放在z-paging标签内，否则会被盖住 -->
			<!-- 需要固定在页面顶部的view请通过slot="top"插入，包括自定义的导航栏 -->
			<view slot="top" class="">
				<back :title="title"></back>
				<view class="" style="height: 150rpx;"></view>
				<!-- <view class="search_box" >
					<view class="search_box_right">
						<view class="search_input_icon">
							<u-icon name="search" color="#333" size="28"></u-icon>
						</view>
						<input class="search_input" @confirm="search_submit"  v-model="name" type="text" placeholder-class="search" placeholder="请搜索名称" />
						<view  @click="search_submit" class="search_btn">
							搜索
						</view>
					</view>
				</view> -->
			</view>
		    <view class="user_list" >
				<view v-for="(item,index) in dataList" :key="index" class="list_item">
					<image :src="item.pic?item.pic:'../../static/inde_png/index_icon_19.png'" style="width:80rpx; border-radius: 10rpx; height: 80rpx;" mode=""></image>
					<view class="list_item_right">
						<span class="nick_name_spna" style="margin-right: 15rpx;">{{item.nickname}}</span>
						<!-- <view class="bar_vip">
							<view class="bar_vip_left">
								<image src="../../static/vip/icon_59.png" style="width:18rpx; height: 18rpx;" mode=""></image>
							</view>
							<view class="bar_vip_right">
								黄金会员
							</view>
						</view> -->
					</view>
				</view>
				<!-- <view v-for="(item,index) in dataList" :key="index" class="list_item">
					<image :src="item.pic" style="width:100rpx; border-radius: 100rpx; height: 100rpx;" mode=""></image>
					<view class="list_item_right">
						<span>昵称：{{item.nickname}}</span>
						<span>手机号：{{item.mobile}}</span>
						<span>邮箱：{{item.email}}</span>
					</view>
				</view> -->
		    </view>
		</z-paging>
	</view>
</template>

<script>
	import back from '@/componts/back.vue';
	export default {
		components: {
			back
		},
		data() {
			return {
				type:0,
				title:'',
				dataList:[],
				style:{}
			}
		},
		onLoad(data) {
			// 2下级分销商 3客户
			if(data.type == 2){
				this.title = '我的分销商'
			}
			if(data.type == 3 ){
				this.title = '我的客户'
			}
			this.type = data.type
		},
		onShow() {
			var style =  uni.getStorageSync('style')
			style = JSON.parse(style)
			this.style = style
		},


		methods: {
			queryList(pageNo, pageSize) {
				var data = {
					"page": pageNo, 
					"limit": pageSize ,
					"dealer_level":this.type //2下级分销商 3客户
				}
				this.$wqzApi.UserDealer_lower_level_list(data).then(res=>{
					this.$refs.paging.complete(res.data.list);
				}).catch(err=>{
					this.$refs.paging.complete(false);
				})
			},
		}
	}
</script>
<style lang="scss" scoped>
	@import url(./my_user_list.css);
</style>